<div class="mt20 clearfix" style="text-align: right;">
    <button href="javascript:;" class="btn"
            ng-if="contractBaseInfo.contract_status == 0 && userAuthList.indexOf('0001') !== -1"
            ng-click="onProductAdd()"
    >
        新增产品
    </button>
</div>
<div id="grid" class="table-wrap mt10 ml25" style="min-height: 200px;">

    <table width="100%">
        <thead>
        <tr>
            <th>序号</th>
            <th width="100">产品名称</th>
            <th class="align-r">标准单价(每项目、每年)</th>
            <th class="align-m">产品数/短信条数</th>
            <th class="align-r">租用周期(月)</th>
            <th class="align-r">标准总额</th>
            <th class="align-r">结算分摊金额</th>
            <th class="align-r">产品租金分摊金额</th>
            <th class="align-r">签约分摊金额</th>
            <th class="align-m">合同属性</th>
            <th class="align-m">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="project in projects" ng-if="project.__type != 'delete'">
            <td height="40"><p ng-bind="$index + 1"></p></td>
            <td class="lh14">
                <p ng-bind="project.application_name"></p>
            </td>
            <td class="align-r">
                <p ng-if="project.authorization_type == 0">{{project.price|number:2}}</p>

                <p ng-if="project.authorization_type == 1">{{project.unit||(project.price|number:2)}}</p>
            </td>
            <td class="align-m">
                <p ng-if="project.authorization_type == 0">产品数:{{project.authorization_numeric}}</p>

                <p ng-if="project.authorization_type == 1">短信数:{{project.authorization_numeric}}</p>
            </td>
            <td class="align-r">
                <p ng-bind="project.rent_period | number"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.settlement_average_amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.product_average_amount | number:2"></p>
            </td>
            <td class="align-r">
                <p ng-bind="project.sign_average_amount | number:2"></p>
            </td>
            <td class="align-m">
                {{project.contract_type | contractTypeFilter}}
            </td>
            <td class="align-m">
                <div ng-if="userAuthList.indexOf('0001') !== -1">
                    <a href="javascript:;"
                       ng-click="onProductEdit(project)"
                    >修改</a>
                    <a href="javascript:void(0)" ng-click="delProject(project)" title="删除产品"
                       ng-if="contractBaseInfo.contract_status == 0"
                    >删除</a>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="no-data" style="display:none"><span>暂无数据</span></div>

</div>
<div class="ml25 mt10">
    <span class="pl10">产品数合计：{{projects|countProject2|number}}个产品</span>
    <span class="pl10">产品标准总额合计：{{projects|sumProductAmount2|number}}元</span>
    <span class="pl10">短信条数合计：{{projects|countSMS2|number}}条</span>
    <span class="pl10">结算分摊金额合计：<em class="b c-red ng-binding">{{projects|sumSettlementAverageAmount2:'settlement_average_amount'|number}}</em>元</span>
    <span class="pl10">产品租金分摊金额合计：<em class="b c-red ng-binding">{{projects|sumSettlementAverageAmount2:'product_average_amount'|number}}</em>元</span>
    <span class="pl10">签约分摊金额合计：<em class="b c-red ng-binding">{{projects|sumSettlementAverageAmount2:'sign_average_amount'|number}}</em>元</span>
</div>
